<?php

/**
 * Usuario form base class.
 *
 * @package    Tesis
 * @subpackage form
 * @author     Your name here
 */
class BaseUsuarioForm extends BaseFormPropel
{
  public function setup()
  {
    $this->setWidgets(array(
      'id'               => new sfWidgetFormInputHidden(),
      'nombre'           => new sfWidgetFormInput(),
      'apellido'         => new sfWidgetFormInput(),
      'email'            => new sfWidgetFormInput(),
      'institutoempresa' => new sfWidgetFormInput(),
      'motivo'           => new sfWidgetFormInput(),
      'nomusuario'       => new sfWidgetFormInput(),
      'contrasena'       => new sfWidgetFormInput(),
      'estatus'          => new sfWidgetFormInput(),
      'rol_id'           => new sfWidgetFormInput(),
      'pais_id'          => new sfWidgetFormInput(),
    ));

    $this->setValidators(array(
      'id'               => new sfValidatorPropelChoice(array('model' => 'Usuario', 'column' => 'id', 'required' => false)),
      'nombre'           => new sfValidatorString(array('max_length' => 20)),
      'apellido'         => new sfValidatorString(array('max_length' => 20)),
      'email'            => new sfValidatorString(array('max_length' => 50)),
      'institutoempresa' => new sfValidatorString(array('max_length' => 50)),
      'motivo'           => new sfValidatorString(array('max_length' => 150)),
      'nomusuario'       => new sfValidatorString(array('max_length' => 50)),
      'contrasena'       => new sfValidatorString(array('max_length' => 20)),
      'estatus'          => new sfValidatorInteger(),
      'rol_id'           => new sfValidatorInteger(),
      'pais_id'          => new sfValidatorInteger(),
    ));

    $this->widgetSchema->setNameFormat('usuario[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    parent::setup();
  }

  public function getModelName()
  {
    return 'Usuario';
  }


}
